set(BASE_LIB_SRCS)

set(BP_INC_DIR ../include)
include_directories(${BP_INC_DIR})
set(BP_INC_SRCS
    ${BP_INC_DIR}/bp/bp.h
    ${BP_INC_DIR}/bp/bp_error.h
    ${BP_INC_DIR}/bp/bp_platform.h
    ${BP_INC_DIR}/bp/bp_unicode.h
    ${BP_INC_DIR}/bp/bp_string.h
    ${BP_INC_DIR}/bp/bp_urlencode.h)
list(APPEND BASE_LIB_SRCS ${BP_INC_SRCS})
source_group(inc FILES ${BP_INC_SRCS})

set(BASE_SRCS
    bp_utils.h
    bp_utils.c
    bp_error.c
    bp_unicode.c
    bp_string.c)
source_group(base FILES ${BASE_SRCS})
list(APPEND BASE_LIB_SRCS ${BASE_SRCS})

set(IO_SRCS
    bp_urlencode.c)
source_group(io FILES ${IO_SRCS})
list(APPEND BASE_LIB_SRCS ${IO_SRCS})

set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")

set(LIB_BASKPACK_TARGET libbasepack)
add_library(${LIB_BASKPACK_TARGET} ${BASE_LIB_SRCS})
set_property(TARGET ${LIB_BASKPACK_TARGET} PROPERTY C_STANDARD 90)
#set_property(TARGET ${LIB_BASKPACK_TARGET} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")